<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<title>厂房监控系统</title>
    <%@ include file="head.jsp" %>
</head>

<body class="layui-layout-body">

<div class="layui-layout layui-layout-admin">
    <div class="layui-header">
        <div class="layui-logo">厂房监控系统</div>

        <ul class="layui-nav layui-layout-right">
            <li class="layui-nav-item">
                <a id="name">我</a>
                <dl class="layui-nav-child">
			      <dd><a id="user_msg">用户信息管理</a></dd>
			      
			    </dl>
            </li>
            <li class="layui-nav-item"><a id="outSys">退了</a></li>
        </ul>
    </div>

    <div class="layui-side layui-bg-cyan">
        <div class="layui-side-scroll">
            <!-- 左侧导航区域（可配合layui已有的垂直导航） -->
            <ul class="layui-nav layui-nav-tree layui-bg-cyan" >
                <!--超级管理员的功能-->
                <!--<li class="layui-nav-item"><a href="javascript:;" class="option" id="teachersManage">老师管理</a></li>-->
                <!--老师的功能-->
                <li class="layui-nav-item"><a href="javascript:;" class="option" id="cfMap">厂房地图设计</a></li>
                <li class="layui-nav-item"><a href="javascript:;" class="option" id="cfEquipment">厂房设备查看</a></li>
                <li class="layui-nav-item">
                    <a href="javascript:;" >日志查看</a>
                    <dl class="layui-nav-child">
                        <dd><a href="javascript:;" class="option" id="eq_log">设备日志</a></dd>
                        <dd><a href="javascript:;" class="option" id="eq_run">设备上传日志</a></dd>
                        <dd><a href="javascript:;" class="option" id="eq_base_msg">设备基础信息</a></dd>
                        <dd><a href="javascript:;" class="option" id="eq_log_view">设备运行信息分析</a></dd>
                    </dl>
                </li>
                <li class="layui-nav-item"><a href="javascript:;" class="option" id="car_msg">机器人管理</a></li>
                <li class="layui-nav-item">
                    <a href="javascript:;" >机器人日志查看</a>
                    <dl class="layui-nav-child">
                        <dd><a href="javascript:;" class="option" id="car_log">机器人日志</a></dd>
                        <dd><a href="javascript:;" class="option" id="car_runAdd">机器人上传日志</a></dd>
                        
                    </dl>
                </li>
                <!--<li class="layui-nav-item"><a href="javascript:;" class="option" id="viewQuestions">查看题库</a></li>-->
                <!--学生的功能-->
                <!--<li class="layui-nav-item"><a href="javascript:;" class="option" id="doExam">考试</a></li>-->
                <!--<li class="layui-nav-item"><a href="javascript:;" class="option" id="viewScores">查看成绩</a></li>-->
            </ul>
        </div>
    </div>

    <div class="layui-body">
        <!-- 内容主体区域 -->
        <iframe  src="welcome" frameborder="0" id="iframe" style="width: 100%; height: 100%;"></iframe>
    </div>

    <div class="layui-footer">
        <!-- 底部固定区域 -->
        © cfxt.com - 厂房监控系统
    </div>
</div>


<script>
    //JavaScript代码区域
    layui.use(['element','layer'],function(){
        var element = layui.element;
        var layer = layui.layer;
        var $ = layui.$;

        
        var user_name = '${sessionScope.user_name}';
        var id = '${sessionScope.id}' ;
        var deg = '${sessionScope.deg}' ;
        var tui=function(){
        	//alert("name="+user_name + ".");
        	if(user_name == 'null'|| user_name == null|| user_name == ''){
        		alert("对不起请登录！");
        		location.href="login";
        	}
        }
       tui();
        $("#outSys").click(function(){
        	
        	layer.open({
        		  content: '确定要退出吗？'
        		  ,btn: ['取消', '确定']
        		  ,yes: function(index, layero){
        			  layer.close(index);
        		    //按钮【按钮一】的回调
        		  }
        		  ,btn2: function(index, layero){
        			  
        		    location.href="login" ;
        		  }
        		  ,cancel: function(){ 
        		    //return false 开启该代码可禁止点击该按钮关闭
        		  }
        		});
        	
        })
        $("#name").text(user_name);
        $("#user_msg").click(function(){
        	if(deg != '0'){
        		
        		$("#iframe").attr("src","user_revise?id="+id + "&vs="+"vs" );
        	}else{
        		$("#iframe").attr("src","user_select");
        	}
        })
        $(".option").click(function(){
            $("#iframe").attr("src",$(this).attr('id'));
        });
    });
</script>
</body>
</html>
